package com.booksea.xml

/* © 2009 Florian Hars */

import _root_.org.xml.sax.{XMLReader, InputSource}
import xml._

trait SAXFactoryAdapter extends NonBindingFactoryAdapter {

  /**The method [getReader] has to implemented by
      concrete subclasses */
  def getReader(): XMLReader;

  override def loadXML(source: InputSource, parser: SAXParser): Node = {
    val reader = getReader()
    reader.setContentHandler(this)
    scopeStack.push(TopScope)
    reader.parse(source)
    scopeStack.pop
    return rootElem
  }
}

